Nastaveni Eclipse pro praci s OpenCV-2.2.0
------------------------------------------
-File -> New -> C Project
			   Project name: Hello_World_OpenCv
		           Project type: Executable -> Empty Project
			
							-> Next >
		           Select Configurations
						Advanced settings... 
			   -otevreme nastaveni projektu a nastavime cestu ke knihovnam a 
			    vlozime knihovny OpenCV ktere budeme pouzivat.	
---------------------------
---       Setting
---------------------------						
C/C++ Build
	- Settings
		-GCC Compiler 
			-Preprocessor   - nic nesmi byt oznacene
			-Symbols        - nic

			-Includes
				-Includes paths : /usr/local/include/opencv

			-Optimization   - Optimization Level : Optimize more (-O2)
			-Debugging      -Debug Level : None 
                                        - jinak nic
			-Warnings       - jen All warnings(-Wall)
			-Miscellaneous  - Other flags : -c
					- jinak nic
	- Settings
		-GCC Linker 
			-pripojit jen knihovny a nastavit cestu knim,jinak nic neni potreba
			-Libraries
				-Libraries :    opencv_core
						opencv_calib3d
						opencv_contrib
						opencv_flann
						opencv_gpu
						opencv_highgui
						opencv_imgproc
						opencv_legacy
						opencv_ml
						opencv_objdetect
						opencv_video

				-Library search path :  /usr/local/lib
-------------------------------------------------------------------------------------
-mame nastavene vlozene knihovny OpenCV do projektu a muzeme zacit psat kod
- vytvorime si zdrojovy soubor do ktereho budeme psat c kod

-File -> New -> Source File
	
	-vlozime nazev souboru napr. hello_world.c
	-Template: Default C source template

-------------------------------------------------------------------------------------
-vlozime zdrojovy kod s hello world


#define NUMBER 100
#define DELAY 5

CvScalar random_color(CvRNG* rng)
{
  int icolor = cvRandInt(rng);
  return CV_RGB(icolor&255, (icolor>>8)&255, (icolor>>16)&255);
}

int main( int argc, char** argv )
{
  // Set up variables
  CvFont font;
  CvPoint pt;
  CvRNG rng; // Random number generator
  CvSize text_size;
  char window_name[] = "Hello World! The Return";
  int arr[2], i;
  int line_type = CV_AA; // change it to 8 to see non-antialiased graphics
  int width = 1000,     height = 700;
  int width2 = width*2, height2 = height*2;

  // Initialise the random number generator
  rng = cvRNG((unsigned)-1);

  // Create an image
  IplImage* image = cvCreateImage( cvSize(width,height), 8, 3 );

  // Create a window
  cvNamedWindow(window_name, 1 );

  // Zero the image data
  cvZero( image );

  for (i = 1; i < NUMBER; i++)
  {
    // Set random text location
    pt.x=cvRandInt(&rng) % width2 - width;
    pt.y=cvRandInt(&rng) % height2 - height;

    // Initialise random font
    cvInitFont( &font, cvRandInt(&rng) % 8,
	(cvRandInt(&rng)%100)*0.05+0.1, (cvRandInt(&rng)%100)*0.05+0.1,
	(cvRandInt(&rng)%5)*0.1, cvRound(cvRandInt(&rng)%10), line_type );

    // Add text to image
    cvPutText( image, "Hello World!", pt, &font, random_color(&rng));

    // Display image
    cvShowImage(window_name,image);

    // Wait for a tiny little bit
    cvWaitKey(DELAY);
  }

  // Wait for a key stroke, then release memory and exit
  cvWaitKey(0);
  cvReleaseImage(&image);
  cvDestroyWindow(window_name);

  return 0;
}

------------------------------------------------------------------------------
Petr Mizera
27_4_2011
------------------------------------------------------------------------------


